﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using AuchanScan.ViewModels;
using Microsoft.Phone.Controls;

namespace AuchanScan.Views
{
    public partial class SearchPage : PhoneApplicationPage
    {
        public SearchPage()
        {
            DataContext = ViewModels.ViewModelLocator.SearchViewModelStatic;
            InitializeComponent();

        }

        private void TextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                ((SearchViewModel) DataContext).Search(((TextBox) sender).Text);
            }
        }
    }
}
